package com.demo.aop.advice;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class DefaultMethodIntercepterAdvice implements MethodIntercepterAdvice{
    @Override
    public Object intercep(Method method, Object target, Object[] params) {
        Object invoke = null;
        System.out.println("methodIntercepterAdvice 执行前");
        try {
            invoke = method.invoke(target, params);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
        System.out.println("methodIntercepterAdvice 执行后");
        return invoke;
    }
}
